import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Login from '../pages/login.vue'
import Entry from '../pages/entry.vue'
import CtrlMain from '@/pages/CtrlMain.vue'
import datashow from '../pages/datashow.vue'
import Config from '../pages/config.vue'
import Dev from '../pages/dev.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'CtrlMain',
      component: CtrlMain,
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue'),
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
    },
    {
      path: '/entry',
      name: 'entry',
      component: Entry,
      props: true,
      children: [
        {
          path: '/dev',
          name: 'dev',
          component: Dev,
          props: true
        }]
    },
    {
      path: '/data',
      name: 'data',
      component: datashow,
    },
    {
      path: '/policy',
      name: 'policy',
      component: Config,
    },
    {
      path: '/:pathMatch(.*)*',

    }
  ],
})

export default router
